Packet buffer is one of dispensable key technologies in a modern communication device A main function of the packet buffer is to provide buffer for a data block. An Embedded Random Access Memory (Embedded Random Access Memory, referred to as EDRAM) is used to buffer a data packet, and an the EDRAM may be internally divided into a plurality of banks (Banks), which are configured to store a data block and a corresponding write-in address. Generally speaking, writing a data block in a bank needs one or more clock periods. When a data block is being written in a bank, another data block cannot be written in or read from the bank; and another data block can not be written in or read from the bank till the data block is successfully written in the bank. Similarly, reading a data block from a bank needs one or more clock periods (the clock period is in consistent with a clock period of writing a data block in a bank). When reading a data block from a bank, another data block cannot be read from or write in the bank; and another data block can not be read from or written in the bank till the data block is successfully read from the bank.
In the prior art, after a write-in request including a data block is received, a write-in address is selected at random, and then the data block is written in a bank corresponding to the selected write-in address. Selection of the write-in address is random, therefore, write-in addresses that are continuously selected may correspond to the same bank; or a bank corresponding to a selected write-in address that is currently reading another data block. Under this circumstance, a conflict may occur when a data block is written in a bank; or a conflict may occur when a data block is read from a bank, which results in the data blocks being unable to be written continuously, or data blocks being unable to be continuously read in a packet manner, so that working efficiency of the EDRAM is reduced.